<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>
<%
    String callback = request.getParameter("callback");
	String isShow = request.getParameter("isShow") == null ? "" : request.getParameter("isShow");
    String gd_id = request.getParameter("gd_id") == null ? "" : request.getParameter("gd_id");
    String xm_id = request.getParameter("xm_id") == null ? "" : request.getParameter("xm_id");
	String gd_code = request.getParameter("gd_code") == null ? "" : request.getParameter("gd_code");
	String gd_name = request.getParameter("gd_name") == null ? "" : request.getParameter("gd_name");
%>
<html>
	<head>
		<title>更换工单部门</title>
		<style>
			.td1{
				padding-top:10px;
				padding-bottom:5px;
				font-size: 12px;
				background-color: #c0ebd7;
				width:20%;
			}
			.td2{
				padding:5px;
			}
			.tdg{
			padding-top:10px;
			padding-bottom:5px;
			font-size: 12px;
			background-color: #c0ebd7;
			width:20%;
		}
		.tdb{
			padding:5px;
			width:30%;
		}
		</style>
   		 
		<script type="text/javascript">
		jQuery(document).ready(function() {
				$("#dept_id").combotree({
				url:'<%=contextPath %>/springMVC/group/listDepartment',
				method:'POST',
				animate:true,
				lines:true
			});
			
		});
		 
			function doSubmit(obj){
				var dept_id = $("#dept_id").combotree('getValue');
				var dept_name = $("#dept_id").combotree('getText');
				jQuery("#fm").form('submit',{
					url:"<%=contextPath %>/springMVC/gd/updateGdDept?gd_id=<%=gd_id%>&dept_id="+dept_id+"&dept_name="+dept_name+"&xm_id=<%=xm_id%>",
					onSubmit:function(){
						var isValid = jQuery(this).form('validate');
						if(isValid){
							jQuery(obj).hide();
						}
						return isValid;
					},
					success:function(rtJson){
						rtJson = eval('(' + rtJson + ')'); 
						if (rtJson.rtState == '0'){
							warningInfo(rtJson.rtMsrg);
							eval('window.opener.rtCallBack();');
							window.close();
							
						}else{
							jQuery(obj).show();
							warningInfo(rtJson.rtMsrg);
						}
					}
				});
			}

		    
		</script>
	</head>
	<body >
			<div style="width: 97%;padding-left:10px">
	
							<form id="fm"  method="post">
							<table  style="border-collapse: collapse;" width="100%" border="1px" bordercolor="#0eb83a">			
		      				<tr>
								<td align="right" class="td1" nowrap>工单编号：</td>
								<td class="td2" nowrap>
									<input  id="gd_code" name="gd_code" disabled="disabled" value="<%=gd_code%>">
								</td>
								<td align="right" class="td1" nowrap>工单名称：</td>
								<td class="td2" nowrap>
								<input  id="gd_name" name="gd_name" disabled="disabled" value="<%=gd_name%>">
								</td>
							</tr>
								<tr>
									<td align="right"  nowrap class="td1">
										选择变更部门：
									</td>
									<td class="td2" nowrap  colspan="3">
			 							<input  id="dept_id" name="dept_id" class="easyui-combotree">&nbsp;&nbsp; 
									</td>
								
								</tr>
					   		   <tr>
								<td align="right" nowrap class="td1">
								</td>
								<td  nowrap colspan="3">
									<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:false" onclick="doSubmit(this);">保存</a>
									<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:false" onclick="javascript:window.close();">关闭</a>
								</td>
							</tr>
				 			</table>
				 			</form>
			</div>	 		
				 			
	</body>
</html>


